const state = {
    ad: {},
    game: {},
    bookAd: {},
    book: {},
    bookTypes: [],
    music: {}
}
const actions = {
    clearAd: ({ commit }) => {
        commit("CLEARAD")
    },
    saveAd: ({ commit }, payload) => {
        commit('SAVEAD', payload)
    },
    clearGame: ({ commit }) => {
        commit("CLEARGAME")
    },
    saveGame: ({ commit }, payload) => {
        commit("SAVEGAME", payload)
    },
    clearBookAd: ({ commit }) => {
        commit('CLEARBOOKAD')
    },
    saveBookAd: ({ commit }, payload) => {
        commit('SAVEBOOKAD', payload)
    },
    clearBook: ({ commit }) => {
        commit('CLEARBOOK')
    },
    saveBook: ({ commit }, payload) => {
        commit('SAVEBOOK', payload)
    },
    saveBookTypes: ({ commit }, payload) => {
        commit('SAVEBOOKTYPES', payload)
    },
    clearMusic: ({ commit }) => {
        commit('CLEARMUSIC')
    },
    saveMusic: ({ commit }, payload) => {
        commit('SAVEMUSIC', payload)
    }
}
const mutations = {
    CLEARAD: state => state.ad = {},
    SAVEAD: (state, payload) => {
        state.ad = payload
    },
    CLEARGAME: state => state.game = {},
    SAVEGAME: (state, payload) => {
        state.game = payload
    },
    CLEARBOOK: state => state.book = {},
    SAVEBOOK: (state, payload) => {
        state.book = payload
    },
    CLEARBOOKAD: state => state.bookAd = {},
    SAVEBOOKAD: (state, payload) => {
        state.bookAd = payload
    },
    SAVEBOOKTYPES: (state, payload) => {
        state.bookTypes = payload
    },
    CLEARMUSIC: state => state.music = {},
    SAVEMUSIC: (state, payload) => {
        state.music = payload
    }
}

export default {
    state, actions, mutations
}